package business;

import persistence.Role;
import persistence.RoleDAO;
import persistence.User;
import persistence.UserDAO;
import business.exception.BusinessException;

public interface UserManager {
	public void setUserDAO(UserDAO userDAO);
	public UserDAO getUserDAO();
	public void setRoleDAO(RoleDAO roleDAO);
	public RoleDAO getRoleDAO();
	public void addUser(User u) throws BusinessException;
	public void updateUser(User u) throws BusinessException;
	/** returns the User entity corresponding with the username and password */
	public User getUserForCredentials(String username, String password) throws BusinessException;
	public void logout(User u) throws BusinessException;
	public void resetPasswordForUser(User u) throws BusinessException;
	public Boolean userIsInRole(User user, Role role) throws BusinessException;
	public Boolean isAdmin(User user) throws BusinessException;
	public static final String ADMIN_ROLE = "admin";	
}
